fix: support paragraph bar borders (w:pBdr/w:bar)#2742
fix: support paragraph bar borders (w:pBdr/w:bar)#2742Abdeltoto wants to merge 1 commit intosuperdoc-dev:mainfrom
Conversation
Add bar to ParagraphBorders type in contracts, include it in normalizeParagraphBorders so it flows through the pm-adapter, render it as a left-side vertical line in DomPainter, and include it in the paragraph border hash for grouping parity. Closes superdoc-dev#2282 Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 974ecf97af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (borders.bar && borders.bar.style !== 'none') { | ||
| setBorderSideStyle(element, 'left', borders.bar); |
There was a problem hiding this comment.
Include bar border in left-side geometry calculations
Applying borders.bar directly to border-left here introduces a rendering mismatch: the layer box is still expanded from borders.left only (computeBorderSpaceExpansion and computeRenderedBorderWidths), so bar.width/bar.space are not reserved. In paragraphs with only w:bar (or with a wider bar than left), the new bar border is drawn into the content box and can overlap text instead of being offset outward like other paragraph borders.
Useful? React with 👍 / 👎.
Summary
bartoParagraphBorderstype in contracts so it flows through the data modelbarinnormalizeParagraphBorders()in the pm-adapter so the OOXML property is forwarded to the layout formatapplyParagraphBorderStyles()in DomPainterbarin the paragraph border hash for correct grouping comparisonsFiles changed
contracts/src/index.ts—bar?: ParagraphBorderonParagraphBorderspm-adapter/src/attributes/borders.ts—barin sides arraypainters/dom/src/features/paragraph-borders/border-layer.ts— render bar as CSS left borderpainters/dom/src/paragraph-hash-utils.ts— include bar in hashTest plan
w:pBdr/w:barelementsCloses #2282